<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "find_hint".
 *
 * @property integer $id
 * @property string $content
 * @property integer $time
 * @property integer $able
 * @property integer $find_id1
 *
 * @property Find $findId1
 */
class Find_hint extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'find_hint';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['content', 'time', 'find_id1'], 'required'],
            [['content'], 'string'],
            [['time', 'able', 'find_id1'], 'integer'],
            [['find_id1'], 'exist', 'skipOnError' => true, 'targetClass' => Find::className(), 'targetAttribute' => ['find_id1' => 'id']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'content' => 'Content',
            'time' => 'Time',
            'able' => 'Able',
            'find_id1' => 'Find Id1',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getFindId1()
    {
        return $this->hasOne(Find::className(), ['id' => 'find_id1']);
    }
}
